/*
 * @(#)ConnectionTest.java    �汾�� 2010-11-5
 * 
 * Version information
 * 
 * Copyright notice
 */

package cn.edu.nju.software.netTest;

import static org.junit.Assert.*;

import org.junit.Test;

import cn.edu.nju.software.net.Connection;
import cn.edu.nju.software.net.LogType;
import cn.edu.nju.software.net.*;
import java.util.*;

/**
 * Class description goes here.
 * 
 * @version �汾�� 2010-11-5
 * @author lijinsheng
 */
public class ConnectionTest {

	@Test
	public void testGetInstance() {
		//Connection.getInstance();
		assertTrue(true);
	}

	/* A class implementation comment can go here. */

	@Test
	public void testHandleLog() {

		/*if (Connection.getInstance().handleLog("lijinsheng", "1234") == LogType.Student) {
		}*/

		assertTrue(true);
	}

	@Test
	public void testHandleChangePassword() {

		/*assertFalse(Connection.getInstance().handleChangePassword("lijinsheng",
				"123", "123"));*/

		assertTrue(true);
	}

	@Test
	public void testHandlePersonalInformation() {

//		StudentBean student = Connection.getInstance()
//				.handlePersonalInformation("lijinsheng");
//
//		System.out.println(student.getId());
//		System.out.println(student.getName());
//		System.out.println(student.getGender());
//		System.out.println(student.getInstitute());

		assertTrue(true);
	}

	@Test
	public void testHandleCourseView() {

		ArrayList<ArrayList<CourseBean>> courses = Connection.getInstance()
				.handleCourseView("lichuanyi");
		for (CourseBean course : courses.get(0)) {
			System.out.println(course.getId());
			System.out.println(course.getName());
		}

		for (CourseBean course : courses.get(1)) {
			System.out.println(course.getId());
			System.out.println(course.getName());
		}

		assertTrue(true);
	}

	@Test
	public void testHandleChooseCourse() {

//		ArrayList<CourseBean> courses = new ArrayList<CourseBean>();
//		courses.add(new CourseBean("1", "java", "ruanyuan", "", 1, 1, "", false));
//		assertFalse(Connection.getInstance().handleChooseCourse("lijinsheng",
//				courses));

		assertTrue(true);
	}

	@Test
	public void testHandleAdministratorCourseView() {
//		for (CourseBean course : Connection.getInstance()
//				.handleAdministratorCourseView()) {
//			System.out.println(course.getId());
//			System.out.println(course.getName());
//			System.out.println(course.getPlace());
//		}
//		assertFalse(Connection.getInstance().handleShareCourse());
		assertTrue(true);
	}

	@Test
	public void testHandleAddCourse() {

//		ArrayList<CourseBean> courses = new ArrayList<CourseBean>();
//		courses.add(new CourseBean("1", "java", "ruanyuan", "dongshao", 1, 1,
//				"hh", false));
//		assertFalse(Connection.getInstance().handleAddCourse(courses));

		assertTrue(true);
	}

	@Test
	public void testHandleDeleteCourse() {

//		ArrayList<CourseBean> courses = new ArrayList<CourseBean>();
//		CourseBean course1 = new CourseBean();
//		course1.setId("java");
//		CourseBean course2 = new CourseBean();
//		course2.setId("C++");
//		courses.add(course1);
//		courses.add(course2);
//		assertFalse(Connection.getInstance().handleDeleteCourse(courses));

		assertTrue(true);
	}

	@Test
	public void testHandleAdministratorStudentView() {

//		for (StudentBean student : Connection.getInstance()
//				.handleAdministratorStudentView()) {
//			System.out.println(student.getId());
//			System.out.println(student.getName());
//			System.out.println(student.getGender());
//		}

		assertTrue(true);
	}

	@Test
	public void testHandleAddStudent() {

//		ArrayList<StudentBean> students = new ArrayList<StudentBean>();
//		students.add(new StudentBean("lijinsheng", "123", "081", "lijinsheng",
//				"nan", "ruanjian"));
//		students.add(new StudentBean());
//		assertFalse(Connection.getInstance().handleAddStudent(students));

		assertTrue(true);
	}

	@Test
	public void testHandleDeleteStudent() {

//		ArrayList<StudentBean> students = new ArrayList<StudentBean>();
//		students.add(new StudentBean("lijinsheng", "123", "081", "lijinsheng",
//				"nan", "ruanjian"));
//		students.add(new StudentBean());
//		assertFalse(Connection.getInstance().handleDeleteStudent(students));

		assertTrue(true);
	}

	@Test
	public void testHandleShareCourse() {

//		ArrayList<StudentBean> students = new ArrayList<StudentBean>();
//		students.add(new StudentBean("lijinsheng", "123", "081", "lijinsheng",
//				"nan", "ruanjian"));
//		students.add(new StudentBean());
//		assertFalse(Connection.getInstance().handleDeleteStudent(students));
//		assertFalse(Connection.getInstance().handleShareCourse());
		assertTrue(true);
	}

}
